<%@ page language="java" pageEncoding="utf-8"%>

<!DOCTYPE html>
<html>
<head>
    <%@include file="../common/base.jsp"%>
	<meta charset="utf-8" />
	<meta name ="viewport" content ="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
	<meta http-equiv="expires" content="0">
	<title>待评价</title>
    <link rel="stylesheet" type="text/css" href="${base}/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="${base}/css/global.css?version=${version}">
    <link rel="stylesheet" type="text/css" href="${base}/css/takecar.css?version=${version}">
    <style type="text/css">
        .layui-layer {
            border-radius: 0px !important;
        }
		.evaluate{
			text-align: center;
			width: 80%;
			margin: 0 auto;
			margin-top: 23px;
		}
		.ratesBox{
			text-align: center;
			width: 94%;
			margin: 0 auto;
		}
		.ratesBox:after,.ratesBox:before{
			content: '';
			display: block;
			clear: both;
		}
		.rateBox{
			/* width: 35%; */
			display: inline-block;
			/*display: none;*/
			text-align: center;
			border: solid 1px #e4e7ea;
			padding: 5px;
			font-size: 18px;
			color: #9ea7b1;
			border-radius: 4px;
			padding: 5px 10px;
			margin-top: 10px;
			margin-left: 10px;
			text-decoration: none;
		}

		.rateBox:nth-child(even){
			margin-left: 15px;
		}
		.content-ch{
			margin-top: 10px;
			font-size: 16px;
		}
		.layermchild{ -webkit-overflow-scrolling: touch;}
    </style>
</head>
<body>
    <div class="container-fluid">
    	<div class="divBox driver-info">
			<%@include file="driverHtml.jsp"%>
			<p class="tip" id="tip">感觉怎么样，评价一下司机师傅吧</p>
    	</div>
		<%@include file="startEnd.jsp"%>

		<div>
			<div class="paymoney" style="text-align: center;margin-top: 20px">
				<div class="m-totalFare">共<span id="totalFare"></span>元</div>
				<div class="m-totalFare"><div class="m-totalFare m-fareinfo">查看明细</div></div>
				<div class="text-center btn-rated"  id="center-score">
					<img class="img" src="${base}/images/star_big.png">
					<img class="img" src="${base}/images/star_big.png">
					<img class="img" src="${base}/images/star_big.png">
					<img class="img" src="${base}/images/star_big.png">
					<img class="img" src="${base}/images/star_big.png">
				</div>
			</div>
			<div class="evaluate" id="evaluateTag">
			</div>
		</div>
    </div>
</body>
<script type="text/javascript" src="${base}/js/jquery.min.js"></script>
<script type="text/javascript" src="${base}/plugin/layer-v3.0.3/layer.js"></script>
<script type="text/javascript" src="${base}/js/localStorageOpt.js?version=${version}"></script>
<%--<script type="text/javascript" src="${base}/plugin/crypto-js/crypto-js.min.js"></script>--%>
<%--<script type="text/javascript" src="${base}/plugin/jsencrypt/jsencrypt.min.js"></script>--%>
<script type="text/javascript" src="${base}/js/utils.js?version=${version}"></script>
<iframe src="" frameborder="0" style="display: none;"></iframe>
<script type="text/javascript">
jQuery(document).ready(function($) {
	
	var $document = $(document);
    var yun=new yueajax( "${openId}");
    var isRated;
	var typeModule=''
    getOrderStatus(function (data) {
        //订单创建时间
        var cTime=new Date(data.data.createOn);
        var driver=data.data.driver;
        var cTobj=yun.time_count(cTime)
        $('#faceimg').attr('src',driver.face || '${base}/images/man.png');
        $('#driver_name').html(driver.name);
        $('#driver_score').append(driver.score)
        $('#driver_orderCount').html(driver.orderCount+'单')
        $('#driver_plateNum').html(driver.plateNum)
        $('#driver_carColor_brandName').html(driver.carColor+driver.brandName);
        $('#driver_mobile').attr('href','tel:'+driver.mobile);
        $('#clickCall').attr('href','tel:'+driver.mobile);
        $('#creadtime').html(cTobj.day+'  '+cTobj.hour+cTime.format('hh:mm'));
        $("#originDetailAddressText").html(data.data.originAddress);
        $("#destDetailAddressText").html(data.data.destAddress);
        $('.m-fareinfo').attr('orderUuid',yun.orderUuid);
        isRated=data.data.subStatus;
        typeModule=data.data.typeModule;
//		订单
        if(isRated==610){
            var comment=data.data.comment;
//            setLocalStorage('comment',data.data.comment);
			var k=$('#center-score img');
			for(var i=0;i<comment.score;i++){
			    $(k[i]).attr('src','${base}/images/star_pre_big.png')
			}
//            var eva=!comment.content?comment.evaluateTag:comment.evaluateTag+',"'+comment.content+'"';
			var cH='<div class="ratesBox" >',cD=(!comment.evaluateTag?"":comment.evaluateTag).split(',');
			for(var i=0;i<cD.length;i++){
                if(!cD[i]){
                    continue;
                }
                cH+='<div class="rateBox">'+cD[i]+'</div>'
			}
			cH+='</div>'
            cH+='<p class="content-ch">'+(!!comment.content?'"'+comment.content+'"': "")+'</p>'
            $('#evaluateTag').html(cH);
            $('#tip').html('订单已完成');
            $('title').html('完成订单')
        }

    })
    function getOrderStatus(callback) {
        yun.order_ajax(function(data){
            var d=data.data;
            changeUrl(data.data.subStatus,yun.orderUuid);

            //请求司机等待时间和等待费用
            if(typeof callback =="function"){
                callback(data);
            }
            $('#totalFare').html(d.totalFare);
        },function (data) {
			layer.msg(data.msg);
        })
    }
    //    费用详情
    $document.on('touchend', '.m-fareinfo', function () {
        layer.open({
            type: 2,
            title: false,
            closeBtn: 0,
            shadeClose: true,
            //skin: 'layui-layer-rim', //加上边框
            area: ['100%', '100%'], //宽高,
            anim: 'up',
            content:'${base}/yue/fareInfo?orderUuid='+yun.orderUuid+'&typemodule='+typeModule,
            offset: 'lb',
            scrollbar:true,
            success:function(index){
                index.addClass('notradius')
            }
        });
    });

    $document.on('touchend','.btn-rated',function(e){
//        if(!typeof isRated){return;}
        if(isRated===600){
            layer.open({
                type: 2,
                title: false,
                closeBtn: false,
                shadeClose: false,
                //skin: 'layui-layer-rim', //加上边框
                area: ['100%', '350px'], //宽高,
                shadeClose: true,
                anim: 'up',
                content: '${base}/yue/ratedialog?orderUuid='+yun.orderUuid+"&num="+$(e.target).index(),
                offset: 'lb'
            });
            return ;
		}
        if(isRated===610){
            return;
            layer.open({
                type: 2,
                title: false,
                closeBtn: false,
                shadeClose: false,
                //skin: 'layui-layer-rim', //加上边框
                area: ['100%', '350px'], //宽高,
                shadeClose: true,
                anim: 'up',
                content: '${base}/yue/ratedetail?orderUuid='+yun.orderUuid,
                offset: 'lb'
            });
		}
    });
});
</script>
</html>